package com.jeff.cloud.configclient.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 在Controller中通过注解@Value("${profile}"),绑定Git仓库配置文件中的profile属性
 * @author: jeff
 * @date: 2021/8/12 17:36
 */
@RefreshScope
@RestController
public class ConfigClientController {
    @Value("${profile}")
    private String profile;
    @GetMapping("/profile")
    public String hello(){
        return this.profile;
    }
}
